<?php echo $this->fetch('header.html'); ?>
<style type="text/css">
tr td.handler, th.handler {text-align:center; width:280px;}
</style>
<div id="rightTop">
    <p>专题页面</p>
    <ul class="subnav">
        <li><span>管理专题页面</span></li>
        <li><a class="btn3" href="index.php?module=specialpage&amp;act=add">添加专题页面</a></li>
    </ul>
</div>

<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <?php if ($this->_var['specialpages']): ?>
        <tr class="tatr1">
            <td width="20" class="firstCell"><input id="checkall_1" type="checkbox" class="checkall"/></td>
            <td>专题名称</td>
            <td>限制店铺等级</td>
            <td>状态</td>
            <td>起始日期</td>
            <td class="handler">操作</td>
        </tr>
        <?php endif; ?>
        <?php $_from = $this->_var['specialpages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'val');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['val']):
?>
        <tr class="tatr2">
            <td width="20" class="firstCell">
            <input type="checkbox" class="checkitem" value="<?php echo $this->_var['key']; ?>" />
            </td>
            <td><?php echo htmlspecialchars($this->_var['val']['name']); ?></td>
            <td><?php echo htmlspecialchars($this->_var['val']['sgrades']); ?></td>
            <td class="table_center <?php if ($this->_var['gmtime'] < $this->_var['val']['starttime'] || $this->_var['gmtime'] > $this->_var['val']['endtime']): ?>red<?php endif; ?>">
            <div class="left"><?php echo $this->_var['specialpage_status'][$this->_var['val']['status']]; ?>&nbsp;</div>
            <?php if ($this->_var['val']['status'] == $this->_var['specialpage_status_code']['status_ready']): ?><a style="color:#ffffff" class="btn2 left" href="index.php?module=specialpage&amp;act=start&amp;id=<?php echo $this->_var['val']['spec_id']; ?>">开始</a><?php elseif ($this->_var['val']['status'] == $this->_var['specialpage_status_code']['status_run']): ?><a style="color:#ffffff" class="btn2 left" href="index.php?module=specialpage&amp;act=stop&amp;id=<?php echo $this->_var['val']['spec_id']; ?>">停止</a><?php endif; ?>
            </td>
            <td class="table_center"><?php echo local_date("Y-m-d",$this->_var['val']['starttime']); ?> 至 <?php echo local_date("Y-m-d",$this->_var['val']['endtime']); ?></td>
            <td class="handler">
            <a target="_blank" href="<?php echo $this->_var['site_url']; ?>/specialpage-<?php echo $this->_var['key']; ?>.html">查看</a>
            |
            <a href="index.php?module=specialpage&amp;act=edit&amp;id=<?php echo $this->_var['key']; ?>">编辑</a>
            | <a href="javascript:if(confirm('您确定要删除它吗？'))window.location = 'index.php?module=specialpage&amp;act=drop&amp;mod=_specialpage_mod&amp;id=<?php echo $this->_var['key']; ?>';">删除</a>
            | <a href="index.php?module=specialpage&amp;act=template&amp;id=<?php echo $this->_var['key']; ?>">模板编辑</a>
<!--            |
            <a href="index.php?module=specialpage&amp;act=goods&amp;id=<?php echo $this->_var['key']; ?>">管理商品</a>
            |
            <a href="index.php?module=specialpage&amp;act=notice&amp;id=<?php echo $this->_var['key']; ?>">店铺通知</a>       
-->            </td>
        </tr>
        <?php endforeach; else: ?>
        <tr class="no_data">
            <td colspan="5">没有符合条件的记录</td>
        </tr>
        <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
        <tfoot>
            <tr>
            <?php if ($this->_var['specialpages']): ?>
                <td width="20" class="firstCell"><label for="checkall1"><input id="checkall_2" type="checkbox" class="checkall"></label></td>
                <td colspan="4" id="batchAction">
                    <span class="all_checkbox"><label for="checkall_2">全选</label></span>&nbsp;&nbsp;
                    <input class="formbtn batchButton" type="button" value="删除" name="id" uri="index.php?module=specialpage&mod=_specialpage_mod&act=drop" presubmit="confirm('您确定要删除它吗？');" />
                </td>
            <?php endif; ?>
            </tr>
        </tfoot>
    </table>

</div>
<?php echo $this->fetch('footer.html'); ?>